Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / .github / workflows / pr_enforce_labels.yml

Displaying Raw • Download

.github/workflows/pr_enforce_labels.yml 6b440e57e64de18d0b2bf59a52ec387e8b7cf2b8 (6b440e57) Text, 1.54 KB

Tff7b72nameTb4b4b4: Ta5d6ffCheckTa5d6ff Ta5d6ffPRTa5d6ff Ta5d6ffLabels

Tff7b72onTb4b4b4:
Tff7b72pull_requestTb4b4b4:
Tff7b72typesTb4b4b4: Tb4b4b4[Te6edf3editedTb4b4b4, Te6edf3labeledTb4b4b4]

Tff7b72concurrencyTb4b4b4:
Tff7b72groupTb4b4b4: Ta5d6ff${{Ta5d6ff Ta5d6ffgithub.workflowTa5d6ff Ta5d6ff}}-${{Ta5d6ff Ta5d6ffgithub.event.pull_request.numberTa5d6ff Ta5d6ff}}
Tff7b72cancel-in-progressTb4b4b4: Ta5d6fftrue

Tff7b72permissionsTb4b4b4:
Tff7b72pull-requestsTb4b4b4: Ta5d6ffread
Tff7b72contentsTb4b4b4: Ta5d6ffread

Tff7b72jobsTb4b4b4:
Tff7b72check-labelTb4b4b4:
T8b949e# Skip bot PRs — they already have labels from the workflows/bots that create them
Tff7b72ifTb4b4b4: Tb4b4b4>Tb4b4b4-
Tff7b72github.event.pull_request.user.login != 'renovate[bot]' &&
Tff7b72github.event.pull_request.user.login != 'github-actions[bot]' &&
Tff7b72github.event.pull_request.user.login != 'dependabot[bot]' &&
Tff7b72github.event.pull_request.head.ref != 'scheduled-updates' &&
Tff7b72github.event.pull_request.head.ref != 'l10n_main'
Tff7b72runs-onTb4b4b4: Ta5d6ffubuntu-24.04-arm
Tff7b72stepsTb4b4b4:
Tb4b4b4- Tff7b72nameTb4b4b4: Ta5d6ffCheckTa5d6ff Ta5d6ffforTa5d6ff Ta5d6ffPRTa5d6ff Ta5d6fflabels
Tff7b72usesTb4b4b4: Ta5d6ffactions/github-script@v9
Tff7b72withTb4b4b4:
Tff7b72scriptTb4b4b4: Tb4b4b4|
Tff7b72// Extract labels from the payload directly to avoid extra API calls
Tff7b72const latestLabels = context.payload.pull_request.labels.map(label => label.name);
Tff7b72const requiredLabels = ['bugfix', 'enhancement', 'automation', 'dependencies', 'repo', 'release', 'refactor', 'desktop', 'chore', 'ci', 'build', 'testing', 'documentation'];
Tff7b72console.log('Labels from payload:', latestLabels);
Tff7b72const hasRequiredLabel = latestLabels.some(label => requiredLabels.includes(label));
Tff7b72if (!hasRequiredLabel) {
Tff7b72core.setFailed(`PR must have at least one of the following labels before it can be merged: ${requiredLabels.join(', ')}.`);
Tff7b72}

Served by rngit 1.5.2 - Generated in 0.05s